﻿using Elderlyhealth.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Elderlyhealth.BLL
{
    public class EmployeeService
    {
        public int CheckLogin(string username, string phone)
        {
            using (var db = new DataClasses1DataContext())
            {
                var employee = db.Temployee员工
                    .FirstOrDefault(e => e.员工姓名 == username && e.电话 == phone);

                if (employee != null)
                {
                    return employee.员工id;
                }
            }

            return -1; // 如果没有找到匹配的记录，返回-1
        }
    }
}
